package com.cn.wanxi.model;

import java.util.List;

/**
 * 返回页面的结果
 */
public class ResultModel<T> {
    private String code;//编码
    private String result;//结果提示
    private final String SUCCESSCODE = "200";
    private final String ERRORCODE = "400";
    private final String SUCCESSRESULT = "";
    private final String ERRORRESULT = "";

    private Integer count;

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    private Object object;//返回给页面的数据

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }

    public ResultModel() {
    }

    public ResultModel(Object object) {
        this.object = object;
    }

    public ResultModel(int num) {
        if (num > 0) {
            this.code = this.SUCCESSCODE;
            this.result = this.SUCCESSRESULT;
        } else {
            this.code = this.ERRORCODE;
            this.result = this.ERRORRESULT;
        }
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }
}
